import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import '../src/assets/css/index.css'
import '../src/assets/fonts/iconfont.css'
// 导入格式工具的插件
import moment from 'moment'
import axios from 'axios'
import TreeTable from 'vue-table-with-tree-grid'
// 使用文本编辑器
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// 定义一个全局过滤器
Vue.filter('dataFormate', function(datastr, pattern = 'YYYY-MM-DD hh:mm:ss') {
        return moment(datastr).format(pattern)
    })
    // 全局注册组件
Vue.component('tree-table', TreeTable)
Vue.component('quill-editor', quillEditor)
    // 配置请求的根路径
axios.defaults.baseURL = 'http://www.ysqorz.top:8888/api/private/v1/'
    // axios 拦截器,拦截请求
axios.interceptors.request.use(config => {
    config.headers.Authorization = window.sessionStorage.getItem('token')
    return config
})
Vue.prototype.$http = axios
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')